<extend name="Base/common"/>
<block name="body">
	<div class="proDelBox">
		<div class="proDelInfoBox">
			<div class="proDelInfoImgBox">
				<img class="proDelInfoImg" src="{$resInfo['headimgurl']}" />
			</div>
			<div class="proDelInfoConter">
				<p class="proDelInfoP1 defaultAsh">{$info.nickname}</p>
				<p class="proDelInfoP2 defaulticon">账户余额:<span class="defaultred">{$info.money}</span>元</p>
			</div>
		</div>
		
		<div class="proLiBox proDelBorderBottm">
			<p class="proLiConterTel proDelBorderBottm clearfix proLiBoxPadding">
				<span class="left defaultBlack" style="margin-left: 10px;">用户姓名</span>
				<span class="right defaultBlack">{$info.nickname}</span>
			</p>
			<p class="proLiConterTel defaultBlack clearfix proLiBoxPadding">
				<span class="left defaultBlack" style="margin-left: 10px;">性别</span>
				<span class="right defaultBlack"><if condition="$info['sex'] eq 1">男<else />女</if></span>
			</p>
		</div>
		
		<div class="proLiBox proDelBorderBottm">
			<p class="proLiConterTel clearfix proLiBoxPadding proDelBorderBottm">
				<span class="left defaultBlack" style="margin-left: 10px;">手机号码</span>
				<span class="right defaultBlack">{$info.mobile}</span>
			</p>
			<p class="proLiConterTel clearfix proLiBoxPadding" id="QRcode">
				<span class="left defaultBlack" style="margin-left: 10px;">二维码</span>
				<span class="right defaultBlack"><img style="height: 26px;margin-top: -5px;" src="http://qr.topscan.com/api.php?text={$share_url}" /></span>
			</p>
		</div>
		
		<div class="proLiBox proDelBorderBottm">
			<p class="proLiConterTel proDelBorderBottm clearfix proLiBoxPadding list_reset">
				<span class="left defaultBlack" style="margin-left: 10px;">修改密码</span>
				<span class="icon-uniE902 right defaulticon"></span>
			</p>
			<a href="{:U('User/find_pwd')}">
			<p class="proLiConterTel clearfix proLiBoxPadding">
				<span class="left defaultBlack" style="margin-left: 10px;">忘记密码</span>
				<span class="icon-uniE902 right defaulticon"></span>
				
			</p>
			</a>
		</div>
	</div>

        <!-- 弹出窗 -->
        <div class="dailog_mask"></div>
        <div class="dailog clearfix">
            <img src="__IMG__/img_2.png" alt="" class="closeBtn" >
            <h4>修改密码</h4>
            <p class="pwd">
                <input type="text"  class="pwd_text" placeholder="请输入原密码">
                <input name="password" id="password" value="" type="password" class="pwd_pwd">
            </p>
            <p class="pwd">
                <input type="text"  class="pwd_text" placeholder="请输入新密码">
                <input name="repassword" id="repassword" value="" type="password" class="pwd_pwd">
            </p>
            <p class="pwd">
                <input type="text" class="pwd_text" placeholder="请再次输入密码">
                <input name="repasswordtwo" id="repasswordtwo" value="" type="password" class="pwd_pwd">
            </p>
            <div class="info_btn clearfix">
                <input type="button" class="sub_form" value="确定" />
                <input type="button" value="取消" class="closeBtn quexiao" />
            </div>

        </div>
    </div>
<div class="QRcodebox">
	<div class="QRcodemode">
		<div class="QRcodecont">
			<div class="QRcodepoth"><img class="QRcodeimg" src="{$resInfo['headimgurl']}" /><span class="QRcodepothname">{$info.nickname}</span></div>
			<div class="QRcodeconter"><img src="http://qr.topscan.com/api.php?text={:U('Index/index',array('shareuserid'=>$info['id']))}" /><p>扫描上方二维码，立即加入平台。</p></div>
		</div>
		<div class="QRcodeclose"><img id="QRcodecloese" src="__IMG__/QRcodeclose.svg"/></div>
	</div>
	
</div>
<script type="text/javascript">
$('#QRcode').click(function(){
	$('.QRcodebox').show();
})
$('#QRcodecloese').click(function(){
	$('.QRcodebox').hide();
})
    $(document).ready(function(){
        /*密码框*/
        $(".pwd").find(".pwd_text").focus(function() {
            var text_value = $(this).val();
            if (text_value == this.defaultValue) {
                var obj=$(this).parent(".pwd")
                $(this).hide();
                obj.find(".pwd_pwd").show().focus();
            }
        });
        $(".pwd_pwd").blur(function() {
            var text_value = $(this).val();
            if (text_value == "") {
                var obj1=$(this).parent(".pwd")
                $(this).hide();
                obj1.find(".pwd_text").show();
            }
        });

        // 弹出窗
        $(".list_reset").click(function(){
            $(".dailog_mask").show();
            $(".dailog").fadeIn(200);
        })
        $(".closeBtn").click(function(){
            $(".dailog_mask").hide();
            $(".dailog").fadeOut(200);
        })
    })
    //密码修改
    $('.sub_form').click(function(){
        var password=$('#password').val();
        var repassword=$("#repassword").val();
        var repasswordtwo=$('#repasswordtwo').val();
        if(password==''){toast('原密码不能为空',2000);return false;};
        if(repassword==''){toast('新密码不能为空',2000);return false;};
        if(repasswordtwo==''){toast('确认新密码不能为空',2000);return false};
        if(repassword!=repasswordtwo){toast('密码不相同',2000);return false}
        var url="{:U('User/reset_password')}";
        $.post(url,{
            password:password,//表中验证自段
            repassword:repassword,
            repasswordtwo:repasswordtwo,
        },function(date){
            if(date==1){toast('原密码出错',2000)}
            else if(date==2){toast('密码不相同',2000)}
            else if(date==3){toast('修改成功',2000);
                $(".dailog_mask").hide();
                $(".dailog").fadeOut(200);
            }
            else if(date==4){toast('修改失败',2000)}
            else if(date==9){toast('原密码不能为空',2000)}
            else if(date==8){toast('新密码不能为空',2000)}
            else if(date==7){toast('确认新密码不能为空',2000)}
            else{return;}
        })
    })
</script>

</block>